https://linen.dev logo
OpenAI Provider Import Error on Python
# 🖥│support-forum
c
This error happens on OpenAI 1.99.7 and composio 1.0.0rc10 composio-langchain 1.0.0rc10 Can you gives me the latest OpenAI package version that works in python? Traceback (most recent call last): File "/usr/local/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/local/lib/python3.11/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 76, in subprocess_started target(sockets=sockets) File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 61, in run return asyncio.run(self.serve(sockets=sockets)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "uvloop/loop.pyx", line 1518, in uvloop.loop.Loop.run_until_complete File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 68, in serve config.load() File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 467, in load self.loaded_app = import_from_string(self.app) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 21, in import_from_string module = importlib.import_module(module_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/code/app/main.py", line 18, in from app.routes.integrations_v1 import integrations_v1_router File "/code/app/routes/integrations_v1.py", line 28, in from app.utils.composio_handlers import ( File "/code/app/utils/composio_handlers.py", line 2, in from composio import Composio File "/usr/local/lib/python3.11/site-packages/composio/__init__.py", line 7, in from .sdk import Composio File "/usr/local/lib/python3.11/site-packages/composio/sdk.py", line 19, in from composio.core.provider._openai import OpenAIProvider File "/usr/local/lib/python3.11/site-packages/composio/core/provider/_openai.py", line 15, in from openai.types.chat.chat_completion_message_tool_call import ( ImportError: cannot import name 'ChatCompletionMessageToolCall' from 'openai.types.chat.chat_completion_message_tool_call' (/usr/local/lib/python3.11/site-packages/openai/types/chat/chat_completion_message_tool_call.py)
I went down to 1.95.1 and it worked
c
Hey, here's the Pypi link to the package: Can you try on the latest? If issue persist, please share the reproducible code snippet along with requirements.txt // pyproject.toml
c
I see, I was using 1.0.0 because of the new sdk but let me try that one
0.8.7 worked thank you
2 Views